home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / MacMemory.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  35.2 KB  |  1,481 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        MacMemory.a
  3. ;
  4. ;    Contains:    Memory Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__MACMEMORY__') = 'UNDEFINED' THEN
  19. __MACMEMORY__ SET 1
  20.  
  21.  
  22.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  23.     include 'MacTypes.a'
  24.     ENDIF
  25.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  26.     include 'MixedMode.a'
  27.     ENDIF
  28.  
  29.  
  30.  
  31. maxSize                            EQU        $00800000            ;Max data block size is 8 megabytes
  32.  
  33. defaultPhysicalEntryCount        EQU        8
  34.  
  35.                                                             ; values returned from the GetPageState function 
  36. kPageInMemory                    EQU        0
  37. kPageOnDisk                        EQU        1
  38. kNotPaged                        EQU        2
  39.  
  40.                                                             ; masks for Zone->heapType field 
  41. k32BitHeap                        EQU        1                    ; valid in all Memory Managers 
  42. kNewStyleHeap                    EQU        2                    ; true if new Heap Manager is present 
  43. kNewDebugHeap                    EQU        4                    ; true if new Heap Manager is running in debug mode on this heap 
  44. ;  Note: The type "Size" moved to Types.h 
  45.  
  46.  
  47. Zone                    RECORD 0
  48. bkLim                     ds.l    1                ; offset: $0 (0)
  49. purgePtr                 ds.l    1                ; offset: $4 (4)
  50. hFstFree                 ds.l    1                ; offset: $8 (8)
  51. zcbFree                     ds.l    1                ; offset: $C (12)
  52. gzProc                     ds.l    1                ; offset: $10 (16)
  53. moreMast                 ds.w    1                ; offset: $14 (20)
  54. flags                     ds.w    1                ; offset: $16 (22)
  55. cntRel                     ds.w    1                ; offset: $18 (24)
  56. maxRel                     ds.w    1                ; offset: $1A (26)
  57. cntNRel                     ds.w    1                ; offset: $1C (28)
  58. heapType                 ds.b    1                ; offset: $1E (30)        ;  previously "maxNRel", now holds flags (e.g. k32BitHeap)
  59. unused                     ds.b    1                ; offset: $1F (31)
  60. cntEmpty                 ds.w    1                ; offset: $20 (32)
  61. cntHandles                 ds.w    1                ; offset: $22 (34)
  62. minCBFree                 ds.l    1                ; offset: $24 (36)
  63. purgeProc                 ds.l    1                ; offset: $28 (40)
  64. sparePtr                 ds.l    1                ; offset: $2C (44)
  65. allocPtr                 ds.l    1                ; offset: $30 (48)
  66. heapData                 ds.w    1                ; offset: $34 (52)
  67. sizeof                     EQU *                    ; size:   $36 (54)
  68.                         ENDR
  69. ; typedef struct Zone *                    THz
  70.  
  71. MemoryBlock                RECORD 0
  72. address                     ds.l    1                ; offset: $0 (0)
  73. count                     ds.l    1                ; offset: $4 (4)
  74. sizeof                     EQU *                    ; size:   $8 (8)
  75.                         ENDR
  76. LogicalToPhysicalTable    RECORD 0
  77. logical                     ds        MemoryBlock        ; offset: $0 (0)
  78. physical                 ds.b    8 * MemoryBlock.sizeof ; offset: $8 (8)
  79. sizeof                     EQU *                    ; size:   $48 (72)
  80.                         ENDR
  81. ; typedef short                         PageState
  82.  
  83. ; typedef short                         StatusRegisterContents
  84.  
  85.  
  86.  
  87. ;
  88. ; pascal Ptr GetApplLimit(void)
  89. ;
  90.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  91.         Macro
  92.         _GetApplLimit         &dest=(sp)
  93.             move.l            $0130,&dest
  94.         EndM
  95.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  96.         IMPORT_CFM_FUNCTION GetApplLimit
  97.     ENDIF
  98.  
  99. ;
  100. ; pascal THz SystemZone(void)
  101. ;
  102.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  103.         Macro
  104.         _SystemZone           &dest=(sp)
  105.             move.l            $02A6,&dest
  106.         EndM
  107.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  108.         IMPORT_CFM_FUNCTION SystemZone
  109.     ENDIF
  110.  
  111. ;
  112. ; pascal THz ApplicationZone(void)
  113. ;
  114.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  115.         Macro
  116.         _ApplicationZone      &dest=(sp)
  117.             move.l            $02AA,&dest
  118.         EndM
  119.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  120.         IMPORT_CFM_FUNCTION ApplicationZone
  121.     ENDIF
  122.  
  123. ;
  124. ; pascal Handle GZSaveHnd(void)
  125. ;
  126.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  127.         Macro
  128.         _GZSaveHnd            &dest=(sp)
  129.             move.l            $0328,&dest
  130.         EndM
  131.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  132.         IMPORT_CFM_FUNCTION GZSaveHnd
  133.     ENDIF
  134.  
  135. ;
  136. ; pascal Ptr TopMem(void)
  137. ;
  138.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  139.         Macro
  140.         _TopMem               &dest=(sp)
  141.             move.l            $0108,&dest
  142.         EndM
  143.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  144.         IMPORT_CFM_FUNCTION TopMem
  145.     ENDIF
  146.  
  147. ;
  148. ; pascal OSErr MemError(void)
  149. ;
  150.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  151.         Macro
  152.         _MemError             &dest=(sp)
  153.             move.w            $0220,&dest
  154.         EndM
  155.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  156.         IMPORT_CFM_FUNCTION MemError
  157.     ENDIF
  158.  
  159.  
  160.  
  161. ;
  162. ; pascal THz GetZone(void )
  163. ;
  164.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  165.         ; returns:
  166.         ;    THz             <= A0
  167.         _GetZone:    OPWORD    $A11A
  168.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  169.         IMPORT_CFM_FUNCTION GetZone
  170.     ENDIF
  171.  
  172. ;
  173. ; pascal Handle NewHandle(Size byteCount)
  174. ;
  175.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  176.         ; parameters:
  177.         ;    byteCount       => D0
  178.         ; returns:
  179.         ;    Handle          <= A0
  180.         _NewHandle:    OPWORD    $A122
  181.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  182.         IMPORT_CFM_FUNCTION NewHandle
  183.     ENDIF
  184.  
  185. ;
  186. ; pascal Handle NewHandleSys(Size byteCount)
  187. ;
  188.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  189.         ; parameters:
  190.         ;    byteCount       => D0
  191.         ; returns:
  192.         ;    Handle          <= A0
  193.         _NewHandleSys:    OPWORD    $A522
  194.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  195.         IMPORT_CFM_FUNCTION NewHandleSys
  196.     ENDIF
  197.  
  198. ;
  199. ; pascal Handle NewHandleClear(Size byteCount)
  200. ;
  201.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  202.         ; parameters:
  203.         ;    byteCount       => D0
  204.         ; returns:
  205.         ;    Handle          <= A0
  206.         _NewHandleClear:    OPWORD    $A322
  207.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  208.         IMPORT_CFM_FUNCTION NewHandleClear
  209.     ENDIF
  210.  
  211. ;
  212. ; pascal Handle NewHandleSysClear(Size byteCount)
  213. ;
  214.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  215.         ; parameters:
  216.         ;    byteCount       => D0
  217.         ; returns:
  218.         ;    Handle          <= A0
  219.         _NewHandleSysClear:    OPWORD    $A722
  220.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  221.         IMPORT_CFM_FUNCTION NewHandleSysClear
  222.     ENDIF
  223.  
  224. ;
  225. ; pascal THz HandleZone(Handle h)
  226. ;
  227.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  228.         ; parameters:
  229.         ;    h               => A0
  230.         ; returns:
  231.         ;    THz             <= A0
  232.         _HandleZone:    OPWORD    $A126
  233.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  234.         IMPORT_CFM_FUNCTION HandleZone
  235.     ENDIF
  236.  
  237. ;
  238. ; pascal Handle RecoverHandle(Ptr p)
  239. ;
  240.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  241.         ; parameters:
  242.         ;    p               => A0
  243.         ; returns:
  244.         ;    Handle          <= A0
  245.         _RecoverHandle:    OPWORD    $A128
  246.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  247.         IMPORT_CFM_FUNCTION RecoverHandle
  248.     ENDIF
  249.  
  250. ;
  251. ; pascal Handle RecoverHandleSys(Ptr p)
  252. ;
  253.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  254.         ; parameters:
  255.         ;    p               => A0
  256.         ; returns:
  257.         ;    Handle          <= A0
  258.         _RecoverHandleSys:    OPWORD    $A528
  259.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  260.         IMPORT_CFM_FUNCTION RecoverHandleSys
  261.     ENDIF
  262.  
  263. ;
  264. ; pascal Ptr NewPtr(Size byteCount)
  265. ;
  266.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  267.         ; parameters:
  268.         ;    byteCount       => D0
  269.         ; returns:
  270.         ;    Ptr             <= A0
  271.         _NewPtr:    OPWORD    $A11E
  272.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  273.         IMPORT_CFM_FUNCTION NewPtr
  274.     ENDIF
  275.  
  276. ;
  277. ; pascal Ptr NewPtrSys(Size byteCount)
  278. ;
  279.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  280.         ; parameters:
  281.         ;    byteCount       => D0
  282.         ; returns:
  283.         ;    Ptr             <= A0
  284.         _NewPtrSys:    OPWORD    $A51E
  285.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  286.         IMPORT_CFM_FUNCTION NewPtrSys
  287.     ENDIF
  288.  
  289. ;
  290. ; pascal Ptr NewPtrClear(Size byteCount)
  291. ;
  292.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  293.         ; parameters:
  294.         ;    byteCount       => D0
  295.         ; returns:
  296.         ;    Ptr             <= A0
  297.         _NewPtrClear:    OPWORD    $A31E
  298.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  299.         IMPORT_CFM_FUNCTION NewPtrClear
  300.     ENDIF
  301.  
  302. ;
  303. ; pascal Ptr NewPtrSysClear(Size byteCount)
  304. ;
  305.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  306.         ; parameters:
  307.         ;    byteCount       => D0
  308.         ; returns:
  309.         ;    Ptr             <= A0
  310.         _NewPtrSysClear:    OPWORD    $A71E
  311.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  312.         IMPORT_CFM_FUNCTION NewPtrSysClear
  313.     ENDIF
  314.  
  315. ;
  316. ; pascal THz PtrZone(Ptr p)
  317. ;
  318.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  319.         ; parameters:
  320.         ;    p               => A0
  321.         ; returns:
  322.         ;    THz             <= A0
  323.         _PtrZone:    OPWORD    $A148
  324.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  325.         IMPORT_CFM_FUNCTION PtrZone
  326.     ENDIF
  327.  
  328. ;
  329. ; pascal long MaxBlock(void )
  330. ;
  331.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  332.         ; returns:
  333.         ;    long            <= D0
  334.         _MaxBlock:    OPWORD    $A061
  335.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  336.         IMPORT_CFM_FUNCTION MaxBlock
  337.     ENDIF
  338.  
  339. ;
  340. ; pascal long MaxBlockSys(void )
  341. ;
  342.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  343.         ; returns:
  344.         ;    long            <= D0
  345.         _MaxBlockSys:    OPWORD    $A461
  346.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  347.         IMPORT_CFM_FUNCTION MaxBlockSys
  348.     ENDIF
  349.  
  350. ;
  351. ; pascal long StackSpace(void )
  352. ;
  353.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  354.         ; returns:
  355.         ;    long            <= D0
  356.         _StackSpace:    OPWORD    $A065
  357.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  358.         IMPORT_CFM_FUNCTION StackSpace
  359.     ENDIF
  360.  
  361. ;
  362. ; pascal Handle NewEmptyHandle(void )
  363. ;
  364.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  365.         ; returns:
  366.         ;    Handle          <= A0
  367.         _NewEmptyHandle:    OPWORD    $A166
  368.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  369.         IMPORT_CFM_FUNCTION NewEmptyHandle
  370.     ENDIF
  371.  
  372. ;
  373. ; pascal Handle NewEmptyHandleSys(void )
  374. ;
  375.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  376.         ; returns:
  377.         ;    Handle          <= A0
  378.         _NewEmptyHandleSys:    OPWORD    $A566
  379.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  380.         IMPORT_CFM_FUNCTION NewEmptyHandleSys
  381.     ENDIF
  382.  
  383. ;
  384. ; pascal void HLock(Handle h)
  385. ;
  386.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  387.         ; parameters:
  388.         ;    h               => A0
  389.         _HLock:    OPWORD    $A029
  390.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  391.         IMPORT_CFM_FUNCTION HLock
  392.     ENDIF
  393.  
  394. ;
  395. ; pascal void HUnlock(Handle h)
  396. ;
  397.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  398.         ; parameters:
  399.         ;    h               => A0
  400.         _HUnlock:    OPWORD    $A02A
  401.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  402.         IMPORT_CFM_FUNCTION HUnlock
  403.     ENDIF
  404.  
  405. ;
  406. ; pascal void HPurge(Handle h)
  407. ;
  408.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  409.         ; parameters:
  410.         ;    h               => A0
  411.         _HPurge:    OPWORD    $A049
  412.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  413.         IMPORT_CFM_FUNCTION HPurge
  414.     ENDIF
  415.  
  416. ;
  417. ; pascal void HNoPurge(Handle h)
  418. ;
  419.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  420.         ; parameters:
  421.         ;    h               => A0
  422.         _HNoPurge:    OPWORD    $A04A
  423.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  424.         IMPORT_CFM_FUNCTION HNoPurge
  425.     ENDIF
  426.  
  427. ;
  428. ; pascal void HLockHi(Handle h)
  429. ;
  430.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  431.         ; parameters:
  432.         ;    h               => A0
  433.         Macro
  434.         _HLockHi
  435.             dc.w                $A064
  436.             dc.w                $A029
  437.         EndM
  438.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  439.         IMPORT_CFM_FUNCTION HLockHi
  440.     ENDIF
  441.  
  442. ;
  443. ; pascal Handle TempNewHandle(Size logicalSize, OSErr *resultCode)
  444. ;
  445.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  446.         Macro
  447.         _TempNewHandle
  448.             move.w              #$001D,-(sp)
  449.             dc.w                $A88F
  450.         EndM
  451.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  452.         IMPORT_CFM_FUNCTION TempNewHandle
  453.     ENDIF
  454.  
  455. ;
  456. ; pascal Size TempMaxMem(Size *grow)
  457. ;
  458.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  459.         Macro
  460.         _TempMaxMem
  461.             move.w              #$0015,-(sp)
  462.             dc.w                $A88F
  463.         EndM
  464.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  465.         IMPORT_CFM_FUNCTION TempMaxMem
  466.     ENDIF
  467.  
  468. ;
  469. ; pascal long TempFreeMem(void )
  470. ;
  471.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  472.         Macro
  473.         _TempFreeMem
  474.             move.w              #$0018,-(sp)
  475.             dc.w                $A88F
  476.         EndM
  477.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  478.         IMPORT_CFM_FUNCTION TempFreeMem
  479.     ENDIF
  480.  
  481. ;
  482. ; pascal void InitZone(GrowZoneUPP pgrowZone, short cmoreMasters, void *limitPtr, void *startPtr)
  483. ;
  484.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  485.         _InitZone:    OPWORD    $A019
  486.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  487.         IMPORT_CFM_FUNCTION InitZone
  488.     ENDIF
  489.  
  490. ;
  491. ; pascal void SetZone(THz hz)
  492. ;
  493.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  494.         ; parameters:
  495.         ;    hz              => A0
  496.         _SetZone:    OPWORD    $A01B
  497.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  498.         IMPORT_CFM_FUNCTION SetZone
  499.     ENDIF
  500.  
  501. ;
  502. ; pascal Size CompactMem(Size cbNeeded)
  503. ;
  504.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  505.         ; parameters:
  506.         ;    cbNeeded        => D0
  507.         ; returns:
  508.         ;    Size            <= D0
  509.         _CompactMem:    OPWORD    $A04C
  510.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  511.         IMPORT_CFM_FUNCTION CompactMem
  512.     ENDIF
  513.  
  514. ;
  515. ; pascal Size CompactMemSys(Size cbNeeded)
  516. ;
  517.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  518.         ; parameters:
  519.         ;    cbNeeded        => D0
  520.         ; returns:
  521.         ;    Size            <= D0
  522.         _CompactMemSys:    OPWORD    $A44C
  523.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  524.         IMPORT_CFM_FUNCTION CompactMemSys
  525.     ENDIF
  526.  
  527. ;
  528. ; pascal void PurgeMem(Size cbNeeded)
  529. ;
  530.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  531.         ; parameters:
  532.         ;    cbNeeded        => D0
  533.         _PurgeMem:    OPWORD    $A04D
  534.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  535.         IMPORT_CFM_FUNCTION PurgeMem
  536.     ENDIF
  537.  
  538. ;
  539. ; pascal void PurgeMemSys(Size cbNeeded)
  540. ;
  541.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  542.         ; parameters:
  543.         ;    cbNeeded        => D0
  544.         _PurgeMemSys:    OPWORD    $A44D
  545.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  546.         IMPORT_CFM_FUNCTION PurgeMemSys
  547.     ENDIF
  548.  
  549. ;
  550. ; pascal long FreeMem(void )
  551. ;
  552.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  553.         ; returns:
  554.         ;    long            <= D0
  555.         _FreeMem:    OPWORD    $A01C
  556.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  557.         IMPORT_CFM_FUNCTION FreeMem
  558.     ENDIF
  559.  
  560. ;
  561. ; pascal long FreeMemSys(void )
  562. ;
  563.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  564.         ; returns:
  565.         ;    long            <= D0
  566.         _FreeMemSys:    OPWORD    $A41C
  567.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  568.         IMPORT_CFM_FUNCTION FreeMemSys
  569.     ENDIF
  570.  
  571. ;
  572. ; pascal void ReserveMem(Size cbNeeded)
  573. ;
  574.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  575.         ; parameters:
  576.         ;    cbNeeded        => D0
  577.         _ReserveMem:    OPWORD    $A040
  578.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  579.         IMPORT_CFM_FUNCTION ReserveMem
  580.     ENDIF
  581.  
  582. ;
  583. ; pascal void ReserveMemSys(Size cbNeeded)
  584. ;
  585.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  586.         ; parameters:
  587.         ;    cbNeeded        => D0
  588.         _ReserveMemSys:    OPWORD    $A440
  589.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  590.         IMPORT_CFM_FUNCTION ReserveMemSys
  591.     ENDIF
  592.  
  593. ;
  594. ; pascal Size MaxMem(Size *grow)
  595. ;
  596.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  597.         _MaxMem:    OPWORD    $A11D
  598.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  599.         IMPORT_CFM_FUNCTION MaxMem
  600.     ENDIF
  601.  
  602. ;
  603. ; pascal Size MaxMemSys(Size *grow)
  604. ;
  605.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  606.         _MaxMemSys:    OPWORD    $A51D
  607.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  608.         IMPORT_CFM_FUNCTION MaxMemSys
  609.     ENDIF
  610.  
  611. ;
  612. ; pascal void SetGrowZone(GrowZoneUPP growZone)
  613. ;
  614.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  615.         ; parameters:
  616.         ;    growZone        => A0
  617.         _SetGrowZone:    OPWORD    $A04B
  618.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  619.         IMPORT_CFM_FUNCTION SetGrowZone
  620.     ENDIF
  621.  
  622. ;
  623. ; pascal void MoveHHi(Handle h)
  624. ;
  625.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  626.         ; parameters:
  627.         ;    h               => A0
  628.         _MoveHHi:    OPWORD    $A064
  629.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  630.         IMPORT_CFM_FUNCTION MoveHHi
  631.     ENDIF
  632.  
  633. ;
  634. ; pascal void DisposePtr(Ptr p)
  635. ;
  636.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  637.         ; parameters:
  638.         ;    p               => A0
  639.         _DisposePtr:    OPWORD    $A01F
  640.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  641.         IMPORT_CFM_FUNCTION DisposePtr
  642.     ENDIF
  643.  
  644. ;
  645. ; pascal Size GetPtrSize(Ptr p)
  646. ;
  647.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  648.         _GetPtrSize:    OPWORD    $A021
  649.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  650.         IMPORT_CFM_FUNCTION GetPtrSize
  651.     ENDIF
  652.  
  653. ;
  654. ; pascal void SetPtrSize(Ptr p, Size newSize)
  655. ;
  656.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  657.         ; parameters:
  658.         ;    p               => A0
  659.         ;    newSize         => D0
  660.         _SetPtrSize:    OPWORD    $A020
  661.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  662.         IMPORT_CFM_FUNCTION SetPtrSize
  663.     ENDIF
  664.  
  665. ;
  666. ; pascal void DisposeHandle(Handle h)
  667. ;
  668.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  669.         ; parameters:
  670.         ;    h               => A0
  671.         _DisposeHandle:    OPWORD    $A023
  672.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  673.         IMPORT_CFM_FUNCTION DisposeHandle
  674.     ENDIF
  675.  
  676. ;
  677. ; pascal void SetHandleSize(Handle h, Size newSize)
  678. ;
  679.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  680.         ; parameters:
  681.         ;    h               => A0
  682.         ;    newSize         => D0
  683.         _SetHandleSize:    OPWORD    $A024
  684.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  685.         IMPORT_CFM_FUNCTION SetHandleSize
  686.     ENDIF
  687.  
  688. ;  
  689. ;    NOTE
  690. ;    
  691. ;    GetHandleSize and GetPtrSize are documented in Inside Mac as returning 0 
  692. ;    in case of an error, but the traps actually return an error code in D0.
  693. ;    The glue sets D0 to 0 if an error occured.
  694. ;
  695.  
  696. ;
  697. ; pascal Size GetHandleSize(Handle h)
  698. ;
  699.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  700.         _GetHandleSize:    OPWORD    $A025
  701.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  702.         IMPORT_CFM_FUNCTION GetHandleSize
  703.     ENDIF
  704.  
  705. ;
  706. ; pascal Size InlineGetHandleSize(Handle h)
  707. ;
  708.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  709.         ; parameters:
  710.         ;    h               => A0
  711.         ; returns:
  712.         ;    Size            <= D0
  713.         _InlineGetHandleSize:    OPWORD    $A025
  714.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  715.         IMPORT_CFM_FUNCTION InlineGetHandleSize
  716.     ENDIF
  717.  
  718. ;
  719. ; pascal void ReallocateHandle(Handle h, Size byteCount)
  720. ;
  721.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  722.         ; parameters:
  723.         ;    h               => A0
  724.         ;    byteCount       => D0
  725.         _ReallocateHandle:    OPWORD    $A027
  726.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  727.         IMPORT_CFM_FUNCTION ReallocateHandle
  728.     ENDIF
  729.  
  730. ;
  731. ; pascal void ReallocateHandleSys(Handle h, Size byteCount)
  732. ;
  733.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  734.         ; parameters:
  735.         ;    h               => A0
  736.         ;    byteCount       => D0
  737.         _ReallocateHandleSys:    OPWORD    $A427
  738.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  739.         IMPORT_CFM_FUNCTION ReallocateHandleSys
  740.     ENDIF
  741.  
  742. ;
  743. ; pascal void EmptyHandle(Handle h)
  744. ;
  745.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  746.         ; parameters:
  747.         ;    h               => A0
  748.         _EmptyHandle:    OPWORD    $A02B
  749.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  750.         IMPORT_CFM_FUNCTION EmptyHandle
  751.     ENDIF
  752.  
  753. ;
  754. ; pascal void HSetRBit(Handle h)
  755. ;
  756.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  757.         ; parameters:
  758.         ;    h               => A0
  759.         _HSetRBit:    OPWORD    $A067
  760.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  761.         IMPORT_CFM_FUNCTION HSetRBit
  762.     ENDIF
  763.  
  764. ;
  765. ; pascal void HClrRBit(Handle h)
  766. ;
  767.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  768.         ; parameters:
  769.         ;    h               => A0
  770.         _HClrRBit:    OPWORD    $A068
  771.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  772.         IMPORT_CFM_FUNCTION HClrRBit
  773.     ENDIF
  774.  
  775. ;
  776. ; pascal SInt8 HGetState(Handle h)
  777. ;
  778.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  779.         ; parameters:
  780.         ;    h               => A0
  781.         ; returns:
  782.         ;    SInt8           <= D0
  783.         _HGetState:    OPWORD    $A069
  784.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  785.         IMPORT_CFM_FUNCTION HGetState
  786.     ENDIF
  787.  
  788. ;
  789. ; pascal void HSetState(Handle h, SInt8 flags)
  790. ;
  791.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  792.         ; parameters:
  793.         ;    h               => A0
  794.         ;    flags           => D0
  795.         _HSetState:    OPWORD    $A06A
  796.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  797.         IMPORT_CFM_FUNCTION HSetState
  798.     ENDIF
  799.  
  800. ;
  801. ; pascal void PurgeSpace(long *total, long *contig)
  802. ;
  803.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  804.         _PurgeSpace:    OPWORD    $A162
  805.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  806.         IMPORT_CFM_FUNCTION PurgeSpace
  807.     ENDIF
  808.  
  809.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  810. ;    PurgeSpaceTotal and PurgeSpaceContiguous are currently only implement
  811. ;    on classic 68K.  The are the same as PurgeSpace() but return just
  812. ;    one value (either total space purgable or contiguous space purgable).
  813. ;
  814.  
  815. ;
  816. ; pascal long PurgeSpaceTotal(void )
  817. ;
  818.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  819.         ; returns:
  820.         ;    long            <= A0
  821.         _PurgeSpaceTotal:    OPWORD    $A062
  822.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  823.         IMPORT_CFM_FUNCTION PurgeSpaceTotal
  824.     ENDIF
  825.  
  826. ;
  827. ; pascal long PurgeSpaceContiguous(void )
  828. ;
  829.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  830.         ; returns:
  831.         ;    long            <= D0
  832.         _PurgeSpaceContiguous:    OPWORD    $A062
  833.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  834.         IMPORT_CFM_FUNCTION PurgeSpaceContiguous
  835.     ENDIF
  836.  
  837. ;
  838. ; pascal long PurgeSpaceSysTotal(void )
  839. ;
  840.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  841.         ; returns:
  842.         ;    long            <= A0
  843.         _PurgeSpaceSysTotal:    OPWORD    $A562
  844.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  845.         IMPORT_CFM_FUNCTION PurgeSpaceSysTotal
  846.     ENDIF
  847.  
  848. ;
  849. ; pascal long PurgeSpaceSysContiguous(void )
  850. ;
  851.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  852.         ; returns:
  853.         ;    long            <= D0
  854.         _PurgeSpaceSysContiguous:    OPWORD    $A562
  855.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  856.         IMPORT_CFM_FUNCTION PurgeSpaceSysContiguous
  857.     ENDIF
  858.  
  859.     ENDIF
  860. ; *****************************************************************************
  861. ;
  862. ;    The routines: 
  863. ;
  864. ;        BlockMoveUncached
  865. ;        BlockMoveDataUncached
  866. ;        BlockZero
  867. ;        BlockZeroUncached
  868. ;    
  869. ;    are intended for developers writing drivers. They do not exist in 
  870. ;    “InterfaceLib.” You must link with “DriverServicesLib” to access them.
  871. ;    
  872. ;    But since BlockMove and BlockMoveData exist in both “InterfaceLib” and
  873. ;    “DriverServicesLib”, you cannot link with both libraries.
  874. ;    
  875. ;****************************************************************************
  876.  
  877. ;
  878. ; pascal void BlockMove(const void *srcPtr, void *destPtr, Size byteCount)
  879. ;
  880.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  881.         ; parameters:
  882.         ;    srcPtr          => A0
  883.         ;    destPtr         => A1
  884.         ;    byteCount       => D0
  885.         _BlockMove:    OPWORD    $A02E
  886.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  887.         IMPORT_CFM_FUNCTION BlockMove
  888.     ENDIF
  889.  
  890. ;
  891. ; pascal void BlockMoveData(const void *srcPtr, void *destPtr, Size byteCount)
  892. ;
  893.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  894.         ; parameters:
  895.         ;    srcPtr          => A0
  896.         ;    destPtr         => A1
  897.         ;    byteCount       => D0
  898.         _BlockMoveData:    OPWORD    $A22E
  899.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  900.         IMPORT_CFM_FUNCTION BlockMoveData
  901.     ENDIF
  902.  
  903. ;
  904. ; extern void BlockMoveUncached(const void *srcPtr, void *destPtr, Size byteCount)
  905. ;
  906.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  907.         IMPORT_CFM_FUNCTION BlockMoveUncached
  908.     ENDIF
  909.  
  910. ;
  911. ; extern void BlockMoveDataUncached(const void *srcPtr, void *destPtr, Size byteCount)
  912. ;
  913.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  914.         IMPORT_CFM_FUNCTION BlockMoveDataUncached
  915.     ENDIF
  916.  
  917. ;
  918. ; extern void BlockZero(void *destPtr, Size byteCount)
  919. ;
  920.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  921.         IMPORT_CFM_FUNCTION BlockZero
  922.     ENDIF
  923.  
  924. ;
  925. ; extern void BlockZeroUncached(void *destPtr, Size byteCount)
  926. ;
  927.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  928.         IMPORT_CFM_FUNCTION BlockZeroUncached
  929.     ENDIF
  930.  
  931.  
  932. ;
  933. ; pascal void MaxApplZone(void )
  934. ;
  935.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  936.         _MaxApplZone:    OPWORD    $A063
  937.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  938.         IMPORT_CFM_FUNCTION MaxApplZone
  939.     ENDIF
  940.  
  941. ;
  942. ; pascal void SetApplBase(void *startPtr)
  943. ;
  944.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  945.         ; parameters:
  946.         ;    startPtr        => A0
  947.         _SetApplBase:    OPWORD    $A057
  948.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  949.         IMPORT_CFM_FUNCTION SetApplBase
  950.     ENDIF
  951.  
  952. ;
  953. ; pascal void MoreMasters(void )
  954. ;
  955.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  956.         _MoreMasters:    OPWORD    $A036
  957.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  958.         IMPORT_CFM_FUNCTION MoreMasters
  959.     ENDIF
  960.  
  961. ;
  962. ; pascal void SetApplLimit(void *zoneLimit)
  963. ;
  964.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  965.         ; parameters:
  966.         ;    zoneLimit       => A0
  967.         _SetApplLimit:    OPWORD    $A02D
  968.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  969.         IMPORT_CFM_FUNCTION SetApplLimit
  970.     ENDIF
  971.  
  972.  
  973.  
  974. ;
  975. ; pascal void InitApplZone(void )
  976. ;
  977.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  978.         _InitApplZone:    OPWORD    $A02C
  979.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  980.         IMPORT_CFM_FUNCTION InitApplZone
  981.     ENDIF
  982.  
  983.  
  984. ;   Temporary Memory routines renamed, but obsolete, in System 7.0 and later.  
  985. ;
  986. ; pascal void TempHLock(Handle h, OSErr *resultCode)
  987. ;
  988.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  989.         Macro
  990.         _TempHLock
  991.             move.w              #$001E,-(sp)
  992.             dc.w                $A88F
  993.         EndM
  994.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  995.         IMPORT_CFM_FUNCTION TempHLock
  996.     ENDIF
  997.  
  998. ;
  999. ; pascal void TempHUnlock(Handle h, OSErr *resultCode)
  1000. ;
  1001.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1002.         Macro
  1003.         _TempHUnlock
  1004.             move.w              #$001F,-(sp)
  1005.             dc.w                $A88F
  1006.         EndM
  1007.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1008.         IMPORT_CFM_FUNCTION TempHUnlock
  1009.     ENDIF
  1010.  
  1011. ;
  1012. ; pascal void TempDisposeHandle(Handle h, OSErr *resultCode)
  1013. ;
  1014.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1015.         Macro
  1016.         _TempDisposeHandle
  1017.             move.w              #$0020,-(sp)
  1018.             dc.w                $A88F
  1019.         EndM
  1020.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1021.         IMPORT_CFM_FUNCTION TempDisposeHandle
  1022.     ENDIF
  1023.  
  1024. ;
  1025. ; pascal Ptr TempTopMem(void )
  1026. ;
  1027.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1028.         Macro
  1029.         _TempTopMem
  1030.             move.w              #$0016,-(sp)
  1031.             dc.w                $A88F
  1032.         EndM
  1033.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1034.         IMPORT_CFM_FUNCTION TempTopMem
  1035.     ENDIF
  1036.  
  1037. ;
  1038. ; pascal OSErr HoldMemory(void *address, unsigned long count)
  1039. ;
  1040.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1041.         ; parameters:
  1042.         ;    address         => A0
  1043.         ;    count           => A1
  1044.         ; returns:
  1045.         ;    OSErr           <= D0
  1046.         Macro
  1047.         _HoldMemory
  1048.             moveq               #0,D0
  1049.             dc.w                $A05C
  1050.         EndM
  1051.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1052.         IMPORT_CFM_FUNCTION HoldMemory
  1053.     ENDIF
  1054.  
  1055. ;
  1056. ; pascal OSErr UnholdMemory(void *address, unsigned long count)
  1057. ;
  1058.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1059.         ; parameters:
  1060.         ;    address         => A0
  1061.         ;    count           => A1
  1062.         ; returns:
  1063.         ;    OSErr           <= D0
  1064.         Macro
  1065.         _UnholdMemory
  1066.             moveq               #1,D0
  1067.             dc.w                $A05C
  1068.         EndM
  1069.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1070.         IMPORT_CFM_FUNCTION UnholdMemory
  1071.     ENDIF
  1072.  
  1073. ;
  1074. ; pascal OSErr LockMemory(void *address, unsigned long count)
  1075. ;
  1076.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1077.         ; parameters:
  1078.         ;    address         => A0
  1079.         ;    count           => A1
  1080.         ; returns:
  1081.         ;    OSErr           <= D0
  1082.         Macro
  1083.         _LockMemory
  1084.             moveq               #2,D0
  1085.             dc.w                $A05C
  1086.         EndM
  1087.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1088.         IMPORT_CFM_FUNCTION LockMemory
  1089.     ENDIF
  1090.  
  1091. ;
  1092. ; pascal OSErr LockMemoryForOutput(void *address, unsigned long count)
  1093. ;
  1094.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1095.         ; parameters:
  1096.         ;    address         => A0
  1097.         ;    count           => A1
  1098.         ; returns:
  1099.         ;    OSErr           <= D0
  1100.         Macro
  1101.         _LockMemoryForOutput
  1102.             moveq               #10,D0
  1103.             dc.w                $A05C
  1104.         EndM
  1105.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1106.         IMPORT_CFM_FUNCTION LockMemoryForOutput
  1107.     ENDIF
  1108.  
  1109. ;
  1110. ; pascal OSErr LockMemoryContiguous(void *address, unsigned long count)
  1111. ;
  1112.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1113.         ; parameters:
  1114.         ;    address         => A0
  1115.         ;    count           => A1
  1116.         ; returns:
  1117.         ;    OSErr           <= D0
  1118.         Macro
  1119.         _LockMemoryContiguous
  1120.             moveq               #4,D0
  1121.             dc.w                $A05C
  1122.         EndM
  1123.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1124.         IMPORT_CFM_FUNCTION LockMemoryContiguous
  1125.     ENDIF
  1126.  
  1127. ;
  1128. ; pascal OSErr UnlockMemory(void *address, unsigned long count)
  1129. ;
  1130.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1131.         ; parameters:
  1132.         ;    address         => A0
  1133.         ;    count           => A1
  1134.         ; returns:
  1135.         ;    OSErr           <= D0
  1136.         Macro
  1137.         _UnlockMemory
  1138.             moveq               #3,D0
  1139.             dc.w                $A05C
  1140.         EndM
  1141.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1142.         IMPORT_CFM_FUNCTION UnlockMemory
  1143.     ENDIF
  1144.  
  1145. ;
  1146. ; pascal OSErr MakeMemoryResident(void *address, unsigned long count)
  1147. ;
  1148.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1149.         ; parameters:
  1150.         ;    address         => A0
  1151.         ;    count           => A1
  1152.         ; returns:
  1153.         ;    OSErr           <= D0
  1154.         Macro
  1155.         _MakeMemoryResident
  1156.             moveq               #11,D0
  1157.             dc.w                $A05C
  1158.         EndM
  1159.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1160.         IMPORT_CFM_FUNCTION MakeMemoryResident
  1161.     ENDIF
  1162.  
  1163. ;
  1164. ; pascal OSErr ReleaseMemoryData(void *address, unsigned long count)
  1165. ;
  1166.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1167.         ; parameters:
  1168.         ;    address         => A0
  1169.         ;    count           => A1
  1170.         ; returns:
  1171.         ;    OSErr           <= D0
  1172.         Macro
  1173.         _ReleaseMemoryData
  1174.             moveq               #12,D0
  1175.             dc.w                $A05C
  1176.         EndM
  1177.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1178.         IMPORT_CFM_FUNCTION ReleaseMemoryData
  1179.     ENDIF
  1180.  
  1181. ;
  1182. ; pascal OSErr MakeMemoryNonResident(void *address, unsigned long count)
  1183. ;
  1184.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1185.         ; parameters:
  1186.         ;    address         => A0
  1187.         ;    count           => A1
  1188.         ; returns:
  1189.         ;    OSErr           <= D0
  1190.         Macro
  1191.         _MakeMemoryNonResident
  1192.             moveq               #13,D0
  1193.             dc.w                $A05C
  1194.         EndM
  1195.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1196.         IMPORT_CFM_FUNCTION MakeMemoryNonResident
  1197.     ENDIF
  1198.  
  1199. ;
  1200. ; pascal OSErr FlushMemory(void *address, unsigned long count)
  1201. ;
  1202.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1203.         ; parameters:
  1204.         ;    address         => A0
  1205.         ;    count           => A1
  1206.         ; returns:
  1207.         ;    OSErr           <= D0
  1208.         Macro
  1209.         _FlushMemory
  1210.             moveq               #14,D0
  1211.             dc.w                $A05C
  1212.         EndM
  1213.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1214.         IMPORT_CFM_FUNCTION FlushMemory
  1215.     ENDIF
  1216.  
  1217. ;
  1218. ; pascal OSErr GetPhysical(LogicalToPhysicalTable *addresses, unsigned long *physicalEntryCount)
  1219. ;
  1220.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1221.         Macro
  1222.         _GetPhysical
  1223.             moveq               #5,D0
  1224.             dc.w                $A05C
  1225.         EndM
  1226.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1227.         IMPORT_CFM_FUNCTION GetPhysical
  1228.     ENDIF
  1229.  
  1230. ;
  1231. ; pascal OSErr DeferUserFn(UserFnUPP userFunction, void *argument)
  1232. ;
  1233.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1234.         ; parameters:
  1235.         ;    userFunctionargument=> A0
  1236.         ;    argument        => D0
  1237.         ; returns:
  1238.         ;    OSErr           <= D0
  1239.         _DeferUserFn:    OPWORD    $A08F
  1240.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1241.         IMPORT_CFM_FUNCTION DeferUserFn
  1242.     ENDIF
  1243.  
  1244. ;
  1245. ; pascal long DebuggerGetMax(void )
  1246. ;
  1247.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1248.         ; returns:
  1249.         ;    long            <= D0
  1250.         Macro
  1251.         _DebuggerGetMax
  1252.             moveq               #0,D0
  1253.             dc.w                $A08D
  1254.         EndM
  1255.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1256.         IMPORT_CFM_FUNCTION DebuggerGetMax
  1257.     ENDIF
  1258.  
  1259. ;
  1260. ; pascal void DebuggerEnter(void )
  1261. ;
  1262.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1263.         Macro
  1264.         _DebuggerEnter
  1265.             moveq               #1,D0
  1266.             dc.w                $A08D
  1267.         EndM
  1268.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1269.         IMPORT_CFM_FUNCTION DebuggerEnter
  1270.     ENDIF
  1271.  
  1272. ;
  1273. ; pascal void DebuggerExit(void )
  1274. ;
  1275.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1276.         Macro
  1277.         _DebuggerExit
  1278.             moveq               #2,D0
  1279.             dc.w                $A08D
  1280.         EndM
  1281.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1282.         IMPORT_CFM_FUNCTION DebuggerExit
  1283.     ENDIF
  1284.  
  1285. ;
  1286. ; pascal void DebuggerPoll(void )
  1287. ;
  1288.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1289.         Macro
  1290.         _DebuggerPoll
  1291.             moveq               #3,D0
  1292.             dc.w                $A08D
  1293.         EndM
  1294.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1295.         IMPORT_CFM_FUNCTION DebuggerPoll
  1296.     ENDIF
  1297.  
  1298. ;
  1299. ; pascal PageState GetPageState(const void *address)
  1300. ;
  1301.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1302.         ; parameters:
  1303.         ;    address         => A0
  1304.         ; returns:
  1305.         ;    PageState       <= D0
  1306.         Macro
  1307.         _GetPageState
  1308.             moveq               #4,D0
  1309.             dc.w                $A08D
  1310.         EndM
  1311.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1312.         IMPORT_CFM_FUNCTION GetPageState
  1313.     ENDIF
  1314.  
  1315. ;
  1316. ; pascal Boolean PageFaultFatal(void )
  1317. ;
  1318.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1319.         ; returns:
  1320.         ;    Boolean         <= D0
  1321.         Macro
  1322.         _PageFaultFatal
  1323.             moveq               #5,D0
  1324.             dc.w                $A08D
  1325.         EndM
  1326.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1327.         IMPORT_CFM_FUNCTION PageFaultFatal
  1328.     ENDIF
  1329.  
  1330. ;
  1331. ; pascal OSErr DebuggerLockMemory(void *address, unsigned long count)
  1332. ;
  1333.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1334.         ; parameters:
  1335.         ;    address         => A0
  1336.         ;    count           => A1
  1337.         ; returns:
  1338.         ;    OSErr           <= D0
  1339.         Macro
  1340.         _DebuggerLockMemory
  1341.             moveq               #6,D0
  1342.             dc.w                $A08D
  1343.         EndM
  1344.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1345.         IMPORT_CFM_FUNCTION DebuggerLockMemory
  1346.     ENDIF
  1347.  
  1348. ;
  1349. ; pascal OSErr DebuggerUnlockMemory(void *address, unsigned long count)
  1350. ;
  1351.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1352.         ; parameters:
  1353.         ;    address         => A0
  1354.         ;    count           => A1
  1355.         ; returns:
  1356.         ;    OSErr           <= D0
  1357.         Macro
  1358.         _DebuggerUnlockMemory
  1359.             moveq               #7,D0
  1360.             dc.w                $A08D
  1361.         EndM
  1362.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1363.         IMPORT_CFM_FUNCTION DebuggerUnlockMemory
  1364.     ENDIF
  1365.  
  1366. ;
  1367. ; pascal StatusRegisterContents EnterSupervisorMode(void )
  1368. ;
  1369.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1370.         ; returns:
  1371.         ;    StatusRegisterContents <= D0
  1372.         Macro
  1373.         _EnterSupervisorMode
  1374.             moveq               #8,D0
  1375.             dc.w                $A08D
  1376.         EndM
  1377.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1378.         IMPORT_CFM_FUNCTION EnterSupervisorMode
  1379.     ENDIF
  1380.  
  1381.  
  1382. ;  
  1383. ;    StripAddress and Translate24To32 are traps on classic 68K,
  1384. ;    but macro to the identity function on PowerMacs or other OS's.
  1385. ;
  1386.  
  1387. ;
  1388. ; pascal Ptr StripAddress(void *theAddress)
  1389. ;
  1390.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1391.         ; parameters:
  1392.         ;    theAddress      => D0
  1393.         ; returns:
  1394.         ;    Ptr             <= D0
  1395.         _StripAddress:    OPWORD    $A055
  1396.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1397.         IMPORT_CFM_FUNCTION StripAddress
  1398.     ENDIF
  1399.  
  1400.  
  1401. ;
  1402. ; pascal Ptr Translate24To32(void *addr24)
  1403. ;
  1404.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1405.         ; parameters:
  1406.         ;    addr24          => D0
  1407.         ; returns:
  1408.         ;    Ptr             <= D0
  1409.         _Translate24To32:    OPWORD    $A091
  1410.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1411.         IMPORT_CFM_FUNCTION Translate24To32
  1412.     ENDIF
  1413.  
  1414. ;
  1415. ; pascal OSErr HandToHand(Handle *theHndl)
  1416. ;
  1417.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1418.         _HandToHand:    OPWORD    $A9E1
  1419.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1420.         IMPORT_CFM_FUNCTION HandToHand
  1421.     ENDIF
  1422.  
  1423. ;
  1424. ; pascal OSErr PtrToXHand(const void *srcPtr, Handle dstHndl, long size)
  1425. ;
  1426.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1427.         ; parameters:
  1428.         ;    srcPtr          => A0
  1429.         ;    dstHndl         => A1
  1430.         ;    size            => D0
  1431.         ; returns:
  1432.         ;    OSErr           <= D0
  1433.         _PtrToXHand:    OPWORD    $A9E2
  1434.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1435.         IMPORT_CFM_FUNCTION PtrToXHand
  1436.     ENDIF
  1437.  
  1438. ;
  1439. ; pascal OSErr PtrToHand(const void *srcPtr, Handle *dstHndl, long size)
  1440. ;
  1441.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1442.         _PtrToHand:    OPWORD    $A9E3
  1443.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1444.         IMPORT_CFM_FUNCTION PtrToHand
  1445.     ENDIF
  1446.  
  1447. ;
  1448. ; pascal OSErr HandAndHand(Handle hand1, Handle hand2)
  1449. ;
  1450.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1451.         ; parameters:
  1452.         ;    hand1           => A0
  1453.         ;    hand2           => A1
  1454.         ; returns:
  1455.         ;    OSErr           <= D0
  1456.         _HandAndHand:    OPWORD    $A9E4
  1457.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1458.         IMPORT_CFM_FUNCTION HandAndHand
  1459.     ENDIF
  1460.  
  1461. ;
  1462. ; pascal OSErr PtrAndHand(const void *ptr1, Handle hand2, long size)
  1463. ;
  1464.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1465.         ; parameters:
  1466.         ;    ptr1            => A0
  1467.         ;    hand2           => A1
  1468.         ;    size            => D0
  1469.         ; returns:
  1470.         ;    OSErr           <= D0
  1471.         _PtrAndHand:    OPWORD    $A9EF
  1472.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1473.         IMPORT_CFM_FUNCTION PtrAndHand
  1474.     ENDIF
  1475.  
  1476.     IF OLDROUTINENAMES THEN
  1477.     ENDIF    ; OLDROUTINENAMES
  1478.     ENDIF ; __MACMEMORY__ 
  1479.  
  1480.